<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core">
	<head><title>IGNORED</title></head>
	<f:metadata>
		<f:viewParam name="order" value="#{invoiceBean.invoiceId}" />
	</f:metadata>
	<body>
		<ui:composition template="../templates/layout.xhtml">
			<ui:define name="windowTitle">Daily Market | Customer | Invoice</ui:define>
			<ui:define name="logoImage"><h:graphicImage library="images" name="logo_header.jpg" alt="logo" /></ui:define>
			<ui:define name="content">
				<div id="content" class="graphic_bg">
					<div class="form-row header">Invoice #<h:outputText value="#{invoiceBean.invoiceId}" style="font-style: italic;" /></div>
					<h:messages globalOnly="true" styleClass="form-messages" fatalClass="form-messages error" errorClass="form-messages error" warnClass="form-messages warn" infoClass="form-messages" />
					<h:dataTable rendered="#{invoiceBean.renderable}" value="#{invoiceBean.lineItems}" var="lineItem" style="margin-top: 5px; border: solid 4px #FFFFFF; border-collapse: collapse;" rowClasses="odd-row, even-row" headerClass="header-row" columnClasses="id-col,data-col,data-col,data-col,data-col,data-col" >
						<h:column>
							<f:facet name="header">Deal</f:facet>
							<h:outputText value="#{lineItem.deal.shortDesc}" styleClass="deal-title detail" />
							<h:outputText value="#{lineItem.deal.companyDisplay}" styleClass="deal-company" />
						</h:column>
						<h:column>
							<f:facet name="header">Quantity</f:facet>
							<h:outputText value="#{lineItem.quantity}" />
						</h:column>
						<h:column>
							<f:facet name="header">Unit Price</f:facet>
							<h:outputText value="#{lineItem.deal.priceDisplay}" />
						</h:column>
						<h:column>
							<f:facet name="header">Total Price</f:facet>
							<h:outputText value="#{lineItem.totalLineItemPriceDisplay}" />
						</h:column>
						<h:column>
							<f:facet name="header">Item Status</f:facet>
							<h:outputText value="#{lineItem.statusString}" styleClass="#{lineItem.statusStyle}" />
						</h:column>
						<h:column>
							<f:facet name="header">Deal Codes</f:facet>
							<h:dataTable rendered="#{lineItem.hasCodes}" value="#{lineItem.codes}" var="code">
								<h:column>
									<h:outputText style="display: block;" value="#{code.code}" />
								</h:column>
							</h:dataTable>
							<h:outputText styleClass="status warn" rendered="#{not lineItem.hasCodes}" value="Codes Not Available" />
						</h:column>
					</h:dataTable>
					<h:panelGroup styleClass="notification error" rendered="#{not invoiceBean.renderable}">Invalid Order! <h:link styleClass="table-link" outcome="orders">Back to Orders</h:link></h:panelGroup>
				</div>
			</ui:define>
		</ui:composition>
	</body>
</html>
